<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

<script>
    let sex = "男";
    function fn(){
        let sex = "女";
        console.log(sex);
    }
    fn();
    console.log(sex);
</script>

<script>
    let age2 = 21;
    let fn3 = function (){
        function fn2(){
            let age = 20;
            console.log(age);
        }
        fn2();
    }
    fn3();
    console.log(age2)
</script>

<script>
    let str =new String("杜焜");
console.log(str);
</script>

<script>
    let obj = new Object();
    obj.name = "张三";
    obj.sex = "男";
    let p ={
        name:"kk",
        age:"21",
        sex:"male"
    }
    p.name = "mm"
    console.log(p.name);
    let key = "name";
    console.log(p.name);
    console.log(p[key]);
    for(let key in p){
        console.log(key)
        console.log(p[key]);
    }
</script>

<script>
    function Dog(name,color){
        this.name = name;
        this.color = color;
        this.seeDoor = function (){
            console.log(this.name+"坐在门前看门");
        }
        this.eat = function (){
            console.log(this.name+"吃屎");
        }
    }
    let wc = new Dog("旺财","黄色");
    let lf = new Dog("来福","白色");
    wc.seeDoor();
    lf.eat();
</script>

</body>
</html>